package com.pur.zsms.common.exception;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>异常抽象基类 </p>
 * <p>Create Time: 2008-10-13           </p>
 * @author Colin Chen
 */
public abstract class GenericException extends Exception {
	/**	
	 * 信息参数，生成时注入相关信息。
	 */
	private List paramsList = null;

	public List getParamList() {
		return this.paramsList;
	}

	/**	
	 * <p>Description:  增加信息参数，只能在异常中调用            </p>
	 * @param param 信息参数
	 */
	protected void addParam(Object param) {
		if (this.paramsList == null)
			this.paramsList = new ArrayList();
		paramsList.add(param);
	}

	/**	
	 * <p>Description:  增加信息参数，只能在异常中调用       </p>
	 * @param paramsList 信息参数列表
	 */
	protected void addParamList(List paramsList) {
		if (this.paramsList == null)
			this.paramsList = paramsList;
		else
			this.paramsList.add(paramsList);
	}

	protected GenericException(String message) {
		super(message);
	}

	protected GenericException(Throwable cause) {
		super(cause);
	}

	protected GenericException(String message, Throwable cause) {
		super(message, cause);
	}

}
